import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'home_logic.dart';
import 'home_state.dart';

class HomePage extends StatelessWidget {
  final HomeLogic logic = Get.put(HomeLogic());
  final HomeState state = Get.find<HomeLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Obx(()=>Scaffold(
      body: state.pages[state.currentIndex.value],
      bottomNavigationBar: BottomNavigationBar(
        currentIndex: state.currentIndex.value,
        items: state.navigationIconViews.map((e) => e.item).toList(),
        type: BottomNavigationBarType.fixed,
        onTap: (index)=>state.currentIndex.value=index,
      ),
    ));
  }
}
